﻿<Window
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:Net_Chirash_Twitter_TwitterDatabase="clr-namespace:Net.Chirash.Twitter.TwitterDatabase;assembly=TwitterDatabase"
        xmlns:Net_Chirash_Twitter_TwitterZone_WindowComponents_Containers="clr-namespace:Net.Chirash.Twitter.TweetZone.WindowComponents.Containers"
        xmlns:Net_Chirash_Twitter_TwitterZone_WindowComponents="clr-namespace:Net.Chirash.Twitter.TweetZone.WindowComponents"
        xmlns:Net_Chirash_Twitter_TwitterZone="clr-namespace:Net.Chirash.Twitter.TweetZone"
        xmlns:System_Windows_Media="clr-namespace:System.Windows.Media;assembly=WindowsBase"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" 
        x:Class="Net.Chirash.Twitter.TweetZone.UserProfileWindow"
        x:Name="rootWindow"
		Title="{Binding Path=ScreenName,StringFormat={}{0}さんのプロフィール}"
        Height="615" 
        Width="888"
        Style="{DynamicResource MainWindowStyle}"
        Closed="rootWindow_Closed"
    >
    <Window.Resources>
        <Net_Chirash_Twitter_TwitterDatabase:User x:Key="user" d:IsDataSource="True"/>
    </Window.Resources>
    <Grid x:Name="backGrid" DataContext="{Binding Source={StaticResource user}}">
            <Rectangle x:Name="ProfileBackground"/>
        <!-- Backgroundの設定はコードビハインドで-->
        <Grid x:Name="MainGrid" >
            <Grid.Triggers>
                <EventTrigger RoutedEvent="MouseRightButtonDown" >
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                         From="1" To="0"
                                         Duration="0:0:0.3"
                                         />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
                <EventTrigger RoutedEvent="MouseRightButtonUp" >
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                         From="0.1" To="1"
                                         Duration="0:0:0.1"
                                         />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </Grid.Triggers>
            <Grid.RowDefinitions>
                <RowDefinition Height="63.123"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="217.128"/>
                <ColumnDefinition />
                <ColumnDefinition Width="178"/>
            </Grid.ColumnDefinitions>
            <Image x:Name="ProfileImage" Height="200" Margin="8,-49,8.92,0" VerticalAlignment="Top" Source="{Binding Path=ProfileImageUrl}" Grid.Row="1"/>

            <Border Grid.Column="1" Grid.ColumnSpan="2" Margin="8,8,190,6" Background="{StaticResource DarkBrush}" BorderBrush="{StaticResource WhiteBrush}" CornerRadius="5">
                <TextBlock x:Name="ScreenName" TextAlignment="Center" TextWrapping="Wrap" Text="{Binding Path=ScreenName}" FontSize="32" FontWeight="Bold"/>

            </Border>

            <Border Grid.Column="3" Margin="0,8,8,0" Background="{StaticResource DarkBrush}" BorderBrush="{StaticResource WhiteBrush}" CornerRadius="5">

                <StackPanel Margin="0,0,3,0">
                    <TextBlock x:Name="Name"  HorizontalAlignment="Right" Height="20"  TextWrapping="Wrap" Text="{Binding Path=Name}" VerticalAlignment="Top" />
                    <TextBlock x:Name="ID" HorizontalAlignment="Right" TextWrapping="Wrap" Text="{Binding Path=ID,StringFormat=ID:{0}}" />
                    <TextBlock x:Name="CreatedAtTextBlock" Grid.Column="1" HorizontalAlignment="Right" TextWrapping="Wrap" Text="{Binding Path=CreatedAt,StringFormat=since {0:yyyy/MM/dd}}" VerticalAlignment="Top" Height="19" TextAlignment="Right"/>
                </StackPanel>
            </Border>

            <Border Margin="8,176,8,89" Background="{StaticResource DarkBrush}" BorderBrush="{StaticResource WhiteBrush}" CornerRadius="5" Grid.Row="1">
                <Grid x:Name="BitInfoGrid" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto" MinHeight="16.841"/>
                        <RowDefinition Height="Auto" MinHeight="33.315"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.582*"/>
                        <ColumnDefinition Width="0.818*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock TextWrapping="Wrap" Margin="0,3,4.995,3" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Center"><Run Language="ja-jp" Text="フォロワー数"/></TextBlock>
                    <TextBlock x:Name="FollowersCountTextBlock" Grid.Column="1" HorizontalAlignment="Left" Margin="2,3,0,3" TextWrapping="NoWrap" Text="{Binding Path=FollowersCount,StringFormat={}{0}人}" VerticalAlignment="Center" />
                    <TextBlock TextWrapping="Wrap" Margin="0,3,4.995,3" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center"><Run Language="ja-jp" Text="フォロー数"/></TextBlock>
                    <TextBlock x:Name="FriendsCountTextBlock" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" Margin="2,3,0,3" TextWrapping="NoWrap" Text="{Binding Path=FriendsCount,StringFormat={}{0}人}" VerticalAlignment="Center" />
                    <TextBlock TextWrapping="Wrap" Margin="0,3,4.995,3" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Center"><Run Language="ja-jp" Text="お気に入り数"/></TextBlock>
                    <TextBlock x:Name="FavouritesCountTextBlock" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Margin="2,3,0,3" TextWrapping="NoWrap" Text="{Binding Path=FavouritesCount,StringFormat={}{0}ツイート}" VerticalAlignment="Center" />
                    <TextBlock TextWrapping="Wrap" Margin="0,3,4.995,3" Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Center"><Run Language="ja-jp" Text="タイムゾーン"/></TextBlock>
                    <TextBlock x:Name="TimeZoneTextBlock" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" Margin="2,3,0,3" TextWrapping="NoWrap" Text="{Binding TimeZone}" VerticalAlignment="Center" />
                    <TextBlock TextWrapping="Wrap" Margin="0,3,4.995,3" Grid.Row="4" HorizontalAlignment="Right" VerticalAlignment="Center"><Run Language="ja-jp" Text="非公開"/></TextBlock>
                    <TextBlock x:Name="IsProtectedTextBlock" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Left" Margin="2,3,0,3" TextWrapping="NoWrap" Text="{Binding IsProtected}" VerticalAlignment="Center" />
                    <TextBlock TextWrapping="Wrap" Margin="0,3,4.995,3" Grid.Row="5" HorizontalAlignment="Right" VerticalAlignment="Center"><Run Language="ja-jp" Text="認証済み"/></TextBlock>
                    <TextBlock x:Name="IsVerifiedTextBlock" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Left" Margin="2,3,0,3" TextWrapping="NoWrap" Text="{Binding IsVerified}" VerticalAlignment="Center" />
                </Grid>
            </Border>

            <Button x:Name="FollowToggleButton" Content="FollowToggle" Height="15" Margin="8,0,8,8" Grid.Row="1" VerticalAlignment="Bottom" Click="FollowToggleButton_Click" />
            <Button x:Name="BlockeToggleButton" Content="BlockToggle" Height="15" Margin="7.08,0,8.92,35" Grid.Row="1" VerticalAlignment="Bottom" Click="BlockeToggleButton_Click" />
            <Button Content="この人の発言を検索" Height="15" Margin="8,0,8,62" Grid.Row="1" VerticalAlignment="Bottom"/>
            <Button x:Name="CloseButton" Content="閉じる" Grid.Column="3" HorizontalAlignment="Right" Margin="0,0,8,8" Grid.Row="1" VerticalAlignment="Bottom" Width="95" Click="CloseButton_Click"/>

            <Border Background="{StaticResource DarkBrush}"  BorderBrush="{StaticResource WhiteBrush}" CornerRadius="5" Margin="46,32,8,36" Grid.Column="1" Grid.ColumnSpan="2"  Grid.Row="1">
                <Grid x:Name="MainInfoGrid" Margin="4,4,4,4" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" MinHeight="72.877"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="144.81"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Margin="8,8,8,0" TextWrapping="Wrap" Height="20" VerticalAlignment="Top" TextAlignment="Right"><Run Language="ja-jp" Text="自己紹介"/></TextBlock>
                    <TextBlock Grid.Column="1" Margin="8" TextWrapping="Wrap" Text="{Binding Description}"/>
                    <Net_Chirash_Twitter_TwitterZone_WindowComponents:ZonePanel x:Name="TLPanel" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" />

                </Grid>
            </Border>
        </Grid>
    </Grid>
</Window>
